//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#ifndef __CASTRINGINPUTSTREAM_H__
#define __CASTRINGINPUTSTREAM_H__

#include "_CAStringInputStream.h"

CarClass(CAStringInputStream)
{
public:
    CARAPI Available(
        /* [out] */ Int32 * pBytes);

    CARAPI Close();

    CARAPI Mark(
        /* [in] */ Int32 readLimit);

    CARAPI IsMarkSupported(
        /* [out] */ Boolean * pSupported);

    CARAPI Read(
        /* [out] */ Byte * pByte);

    CARAPI ReadBuffer(
        /* [out] */ BufferOf<Byte> * pBuffer);

    CARAPI ReadBufferEx(
        /* [in] */ Int32 offset,
        /* [in] */ Int32 length,
        /* [out] */ BufferOf<Byte> * pBuffer);

    CARAPI Reset();

    CARAPI Skip(
        /* [in] */ Int32 number);

    CARAPI ReadAChar(
        /* [out] */ AChar * pCharacter);

    CARAPI ReadACharArray(
        /* [out] */ BufferOf<AChar> * pcharArray);

    CARAPI ReadACharArrayEx(
        /* [in] */ Int32 offset,
        /* [in] */ Int32 length,
        /* [out] */ BufferOf<AChar> * pcharArray);

    CARAPI ReadAString(
        /* [out] */ AStringBuf * pString);

    CARAPI constructor(
        /* [in] */ AString string);

    CAStringInputStream() : m_pBuf(NULL), m_pos(0), m_tail(0) {}

private:
    AChar * m_pBuf;
    Int32 m_pos;
    Int32 m_tail;
};

#endif // __CASTRINGINPUTSTREAM_H__
